package com.ssh.backup;

import com.ssh.dao.StaffDAOI;
import com.ssh.entity.Staff;

public class StaffServiceImpl implements StaffService {
	private StaffDAOI staffDAOI;



	/**
	 * @return the staffDAOI
	 */
	public StaffDAOI getStaffDAOI() {
		return staffDAOI;
	}



	/**
	 * @param staffDAOI the staffDAOI to set
	 */
	public void setStaffDAOI(StaffDAOI staffDAOI) {
		this.staffDAOI = staffDAOI;
	}



	@Override
	public boolean login(String staffId, String password) {
		// TODO Auto-generated method stub

		// staffDAO.queryStaffByStaffId(staffId).getStaffId().equals("")

		Staff staff = staffDAOI.queryStaffByStaffId(staffId);
		if (staff == null) {
			return false;
		} else {
			if (staff.getPassword().equals(password)) {
				return true;
			} else {
				return false;
			}
		}

	}

}
